<template>
  <div
    class="loading"
    v-if="!text"
    v-loading="isLoading"
    :element-loading-background="bg"
    :element-loading-spinner="Svg"></div>
  <div
    class="loading"
    v-if="text"
    v-loading="isLoading"
    :element-loading-text="text"
    :element-loading-background="bg"
    :element-loading-spinner="Svg"></div>
</template>

<script lang="ts" setup>
import { Svg } from '../model';
import { getTheme } from '../utils/util';
const bg = getTheme().get('background');
const color = getTheme().get('fontColor');
withDefaults(
  defineProps<{
    isLoading: boolean;
    text?: string;
  }>(),
  {
    text: '',
  }
);
</script>

<style lang="less" scoped>
.loading {
  width: 80vw;
  height: 485px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 30px;
  color: v-bind(color);
}
</style>
